package com.example.demo;

import lombok.extern.slf4j.Slf4j;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created with IntelliJ IDEA.
 * User:xieChao
 * Date:2022/12/1 22:43
 */
@RestController
@ResponseBody
@Slf4j
public class UserController {
    //1.得到日志
   // private final static Logger log = LoggerFactory.getLogger(UserController.class);

    @RequestMapping("/sayhi")
    public void sayHi(){
        //2.
        log.trace("我是 trace");
        log.warn("我是 warn");
        log.debug("我是 debug");
        log.error("我是 error");
        log.info("我是 info");
    }
}
